<template>
  <div>
    <div>
      <van-nav-bar
          title="余额明细"
          left-arrow
          @click-left="onClickLeft"
      />
    </div>
    <div style="margin-top: 10px">
      <van-cell :title="bill.classify=='提现'?'出账金额':'入账金额'" style="text-align: left" :value="bill.money+'₱'" value-class="value-class" size="large" />
    </div>
    <div style="margin-top: 30px">
      <van-cell title="类型" style="text-align: left" :value="bill.classify=='提现'?'支出':'收入'" size="large" />
      <van-cell title="交易时间" style="text-align: left" :value="bill.overTime|formatTimer" size="large" />
      <van-cell title="交易单号" style="text-align: left" :value="bill.orderNo" size="large" />
      <van-cell title="剩余余额" style="text-align: left" :value="bill.residueBalance+'₱'" size="large" />
      <van-cell title="备注" style="text-align: left" :value="bill.classify" size="large" />
    </div>
  </div>
</template>

<script>
import axios from "axios";

export default {
  data() {
    return {
      bill:{}
    }
  },
  mounted() {
    this.bill=this.$route.query.data;
  },
  methods: {
    onClickLeft() {
      this.$router.push({
        path: '/detail'
      })
    },
  },
  filters: {
    formatTimer: function(value) {
      let date = new Date(value);
      let y = date.getFullYear();
      let MM = date.getMonth() + 1;
      MM = MM < 10 ? "0" + MM : MM;
      let d = date.getDate();
      d = d < 10 ? "0" + d : d;
      let h = date.getHours();
      h = h < 10 ? "0" + h : h;
      let m = date.getMinutes();
      m = m < 10 ? "0" + m : m;
      let s = date.getSeconds();
      s = s < 10 ? "0" + s : s;
      return y + "-" + MM + "-" + d + " " + h + ":" + m;
    }
  },
}
</script>

<style scoped>
.value-class{
  font-size: 20px !important;
  color: #000000 !important;
}
</style>
